/*
 * Entity PlayerIncome
 * @author hoang.pt
 * $version $Id: PlayerIncome.java 12 2010-08-23 09:00:40Z phantichhoang $
 */

package review.jbe.problem1;

/**
 *
 * @author hoang.pt
 */
public class PlayerIncome extends Player implements Tax {
    /**
     * property to store income of player
     * @var double
     */
    public double income;

    /**
     * constructor
     * @param String name
     * @param double income
     */
    public PlayerIncome(String name, double income) {
        super(name);
        this.income = income;
    }

    /**
     * constructor
     * @param double income
     */
    public PlayerIncome(double income) {
        this.income = income;
    }

    /**
     * method to display income of this player
     */
    @Override
    public void displayDetail() {
        System.out.println("Net income of player " +name+ " is:");
        System.out.println(this.income - this.calculateTax() + " USD");
        //throw new UnsupportedOperationException("Not supported yet.");
    }

    /*
     * calculate tax
     * @see review1.Tax#calculateTax()
     */
    public double calculateTax() {
        //double tax = income * TAX_PERCENT;
        return income * TAX_PERCENT;
        //throw new UnsupportedOperationException("Not supported yet.");
    }

}
